package com.example.service_cms.controller;

import com.example.common.commonsutils.R;
import com.example.service_cms.entity.Banner;
import com.example.service_cms.service.BannerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:tjf
 * @Description:
 */
@RestController
@RequestMapping("/cmsservice/banner")
@Tag(name = "用户端轮播图控制器")
public class FrontBannerController {
    @Resource
    private BannerService bannerService;
    @Operation(description = "查询所有的轮播图")
    @GetMapping("/all")
    public R queryAllBanner(){
        List<Banner> bannerList = bannerService.queryAllBanner();
        return R.ok().data("bannerList", bannerList);
    }
}
